package com.myself.ssoserver.entity

import com.myself.common.entity.BaseEntity
import com.myself.common.table.BaseTable
import net.bytebuddy.implementation.FixedValue.reference
import org.ktorm.database.Database
import org.ktorm.entity.Entity
import org.ktorm.entity.sequenceOf
import org.ktorm.schema.varchar

interface Role : BaseEntity<Role> {
    var code: String
    companion object : Entity.Factory<Role>()
}


object Roles : BaseTable<Role>("sys_role") {
    val code = varchar("code").bindTo { it.code }
    val Database.roles get() = this.sequenceOf(Roles)
}
